import Vue from 'vue';
// 引入 路由
import VueRouter from 'vue-router';
Vue.use(VueRouter);   // 引入后需要 使用


// 导入子组件
import HomeContainer from '../components/layout/HomeContainer.vue';
import MemberContainer from '../components/layout/MemberContainer.vue';
import SearchContainer from '../components/layout/SearchContainer.vue';
import ShopcarContainer from '../components/layout/ShopcarContainer.vue';


const router = new VueRouter({
  routes: [
    // redirect 重定向 默认显示的
    { path: '/', redirect: '/home' },
    { path: '/home', component: HomeContainer },
    { path: '/member', component: MemberContainer },
    { path: '/search', component: SearchContainer },
    { path: '/shaopcar', component: ShopcarContainer },
  ],
  // 切换每个组件添加类
  linkActiveClass: 'mui-active'
})

// 暴露路由
export default router;